<?php

##Dynamic Typecasting of varibales in PHP

$a = 123;
var_dump($a);// int 123
echo $a * 2;
echo "\n\n";

$a = '123';
var_dump($a);//string(3) "123"
echo $a * 2;
echo "\n\n";

$a = '123abc';
var_dump($a);//string(3) "123"
echo $a * 2;
echo "\n\n";


echo (int)'546abcdef2424242';
echo "\n\n";
################ Some Special Cases #########
echo 0123; // Ans:83
echo "\n\n";

echo 0123821; // Ans:83
echo "\n\n";
//-----------------------
echo 0x123; // Ans:
echo "\n\n";
